package model;

import controller.exceptions.InvalidVersionException;
import controller.exceptions.ItemAlreadyRemovedException;
import filesystem.exceptions.InvalidModelItemException;
import java.io.IOException;
import java.util.ArrayList;

/**
 * Model interface
 */
public interface Model {

    /**
     * Add item object to the model
     *
     * @param item new object
     */
    void addItem(ModelItem item) throws InvalidModelItemException, IOException;

    /**
     * Select items from the model by parametr
     *
     * @param parametr parametr of the search
     * @return list of the found objects
     */
    public ArrayList selectItems() throws IOException;
    
    public ArrayList selectItems(ModelItem parametr) throws IOException;

    /**
     * Edit object in the model
     *
     * @param item changing object
     */
    public void setItem(ModelItem item) throws InvalidModelItemException, 
            IOException, InvalidVersionException, ItemAlreadyRemovedException;

    /**
     * Remove object from the model
     *
     * @param item removing object
     */
    public void removeItem(ModelItem item) throws InvalidModelItemException, 
            IOException;

    public ArrayList getItems();
}
